package com.example.second.state;

import android.os.Bundle;
import android.view.View;
import android.widget.Button;

import androidx.appcompat.app.AppCompatActivity;

import com.example.second.R;
import com.example.second.state.classes.RoomLed;

import butterknife.BindView;
import butterknife.ButterKnife;
import butterknife.OnClick;

public class StateActivity extends AppCompatActivity {

    @BindView(R.id.btn_state_led_on)
    Button btnStateLedOn;
    @BindView(R.id.btn_state_led_off)
    Button btnStateLedOff;
    private RoomLed mRoomLed;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_state);
        ButterKnife.bind(this);

        initData();
    }

    private void initData() {
        mRoomLed = new RoomLed();
    }

    @OnClick({R.id.btn_state_led_on, R.id.btn_state_led_off})
    public void onViewClicked(View view) {
        switch (view.getId()) {
            case R.id.btn_state_led_on:
                mRoomLed.setLedOn();
                break;
            case R.id.btn_state_led_off:
                mRoomLed.setLedOff();
                break;
        }
    }
}